package com.efuture.servlet.cookie;

import jakarta.servlet.*;
import jakarta.servlet.http.*;
import jakarta.servlet.annotation.*;
import java.io.IOException;

/**
 * @description: Cookie快速入门
 * @author zhaoshanshan
 * @date 2021/10/3 5:33 下午
 * @version 1.0
 */

@WebServlet("/CookieQuickStartTestOne")
public class CookieQuickStartTestOne extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doPost(request, response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //创建Cookie
        Cookie cookie = new Cookie("msg","测试Cookie");
        //添加cookie
        response.addCookie(cookie);
    }
}
